package com.aglie.controller;


import com.aglie.service.HelloService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


@Api(tags = "Hello测试")
@RestController
@RequestMapping("Hello")
public class HelloController {

    @Autowired
    private HelloService helloService;

    @PostMapping("/downloadTemplate")
    @ApiOperation(value = "指标模版下载",produces = "application/octet-stream")
    public void mbxz(HttpServletResponse response){
        helloService.downloadTemplate(response);
    }

    @PostMapping("/templateFormat")
    @ApiOperation(value = "指标模版格式化",produces = "application/octet-stream")
    public void templateFormat(@RequestParam("file") MultipartFile file, HttpServletResponse response) throws IOException {
        helloService.templateFormat(file,response);
    }

    @GetMapping("/deploy")
    @ApiOperation(value = "全新部署脚本测试")
    public String deploy() {
        return "全新部署脚本成功";
    }




}
